<?php

// +--------------------------------------------
// | Name: 星空后台 管理组验证规则
// +--------------------------------------------
// | Version: V5.0
// +--------------------------------------------
// | Author: xkyinzhe <zhonghuaxinxing@sina.cn>
// +--------------------------------------------
// | Time: 2021-04-21 15：15
// +--------------------------------------------
declare(strict_types=1);

namespace app\common\validate;

use think\Validate;

/**
 * @xk 管理组验证规则
 */
class AdminGroup extends Validate
{
    protected $rule = [
      'admin_group_id' => 'number|min:1',
      'group_name' => 'require|min:2|max:100',
      'auth_rule_id' => 'require',
      'auth_rule_name' => 'require'
    ];

    protected $message = [
      'admin_group_id.number' => '请填写需要操作的管理组',
      'group_name.require' => '请填写管理组名称',
      'auth_rule_id.require' => '请选择管理组权限',
      'auth_rule_name.require' => '请选择管理组权限'
    ];

    protected $scene = [
      'create' => ['group_name', 'auth_rule_id', 'auth_rule_name'],
      'edit' => ['admin_group_id', 'group_name', 'auth_rule_id', 'auth_rule_name']
    ];
}
